
const state = {
    // 全局存储示例：当前语言、主题色、用户信息等
    language: "zh",
    themeColor: "#409EFF", // 默认主题色（Element UI 的 primary blue）
  }
  const mutations = {
    SET_LANGUAGE(state, lang) {
      state.language = lang;
    },
    SET_THEME_COLOR(state, color) {
      state.themeColor = color;
    },
  }
  
  const actions = {
    changeLanguage({ commit }, lang) {
      commit("SET_LANGUAGE", lang);
    },
    changeThemeColor({ commit }, color) {
      commit("SET_THEME_COLOR", color);
      // 同时修改Element UI的主题色
      document.documentElement.style.setProperty("--el-color-primary".color);
    },
  }

  export default {
    namespaced: true,
    state,
    mutations,
    actions
  }